package group_1.MultiSnake;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class CreateGame extends Activity implements OnClickListener {
		
	private Button createGameBtn;
		@Override
		protected void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.creategame);
			
			createGameBtn  = (Button)findViewById(R.id.createBtn);
			setListeners();
			
		}
		public void onClick(View v) {
			switch(v.getId()){
			
			case R.id.createBtn:
				EditText gamename = (EditText)findViewById(R.id.gameName);
				Intent intent = getIntent();
				intent.putExtra(getString(R.string.game_key), gamename.getText().toString());
				setResult(Activity.RESULT_OK, intent);
				this.finish();
				break;
			}
			
			
		}
		
	    private void setListeners() {
	    	createGameBtn.setOnClickListener(this);
	    }
		
}
